package com.tzf.reggie.common;

/**
 * @Author: 田振飞
 * @Description 用于TheadLocal封装工具, 用户保存活获取当前登录用户id,作用范围是每一次请求的线程内
 * @Date: 2022/5/2 09:09
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
